﻿<sap:ActivityDesigner x:Class="WFDataBaseProject.UCSynchronizeActivityDesigner"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:s="clr-namespace:System;assembly=mscorlib"
    xmlns:sap="clr-namespace:System.Activities.Presentation;assembly=System.Activities.Presentation"
    xmlns:sapc="clr-namespace:System.Activities.Presentation.Converters;assembly=System.Activities.Presentation"
    xmlns:sapv="clr-namespace:System.Activities.Presentation.View;assembly=System.Activities.Presentation">
    <sap:ActivityDesigner.Resources>
        <sapc:ArgumentToExpressionConverter x:Key="argumentToExpressionConverter"/>
        <!--Expanded-->
        <DataTemplate x:Key="expanded">
            <StackPanel Orientation="Vertical">
                <!--Connection string-->
                <TextBlock Text="Connection string: "/>
                <sapv:ExpressionTextBox OwnerActivity="{Binding ModelItem}"
                                HintText="Enter the connection string"
                                ExpressionType="{x:Type s:String}"
                                Expression="{Binding ModelItem.SourceConnectionString,
            Mode=TwoWay,
            Converter={StaticResource argumentToExpressionConverter},
            ConverterParameter=In}"/>
                <!--Source table-->
                <TextBlock Text="Source table: "/>
                <sapv:ExpressionTextBox OwnerActivity="{Binding ModelItem}"
                                HintText="Enter full source table name"
                                ExpressionType="{x:Type s:String}"
                                Expression="{Binding ModelItem.SourceTable,
            Mode=TwoWay,
            Converter={StaticResource argumentToExpressionConverter},
            ConverterParameter=In}"/>
                <!--Destnation table-->
                <TextBlock Text="Destination table: "/>
                <sapv:ExpressionTextBox OwnerActivity="{Binding ModelItem}"
                                HintText="Enter full source table name"
                                ExpressionType="{x:Type s:String}"
                                Expression="{Binding ModelItem.DestinationTable,
            Mode=TwoWay,
            Converter={StaticResource argumentToExpressionConverter},
            ConverterParameter=In}"/>
            </StackPanel>
        </DataTemplate>
        <!--Collapsed-->
        <DataTemplate x:Key="collapsed">
            <TextBlock Text="Collapsed mode"/>
        </DataTemplate>
        <!--Style for activity designer-->
        <Style x:Key="displaymodestyle" TargetType="{x:Type ContentPresenter}">
            <Setter Property="ContentTemplate" Value="{DynamicResource expanded}"/>
            <Style.Triggers>
                <DataTrigger Binding="{Binding Path=ShowExpanded}" Value="false">
                    <Setter Property="ContentTemplate" Value="{DynamicResource collapsed}"/>
                </DataTrigger>
            </Style.Triggers>
        </Style>
    </sap:ActivityDesigner.Resources>
    <Grid>
        <ContentPresenter Style="{DynamicResource displaymodestyle}" Content="{Binding}" />
    </Grid>
</sap:ActivityDesigner>
